package com.iv.durian.cloud.dao;

import com.iv.durian.cloud.Student;
import com.iv.durian.cloud.dao.mapper.StudentMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

@Repository
public class StudentDao {

    @Autowired
    private StudentMapper studentMapper;
    public Student get(Integer id, Integer userId, String name, Date birthday){
        return studentMapper.get(id,userId,name,birthday);
    }

    public int add(Student student) { return studentMapper.add(student); }

    public int update(Student student){ return studentMapper.add(student); }

    public int remove(@Param("id") Integer id){ return studentMapper.remove(id); }

    public int count(Integer id){ return studentMapper.count(id); }

    public List<Student> list(Integer id, int offset, int limit){
        return studentMapper.list(id,offset,limit);
    }

}
